package xyz.lne.researchgroupmanage.schedule;

import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import xyz.lne.researchgroupmanage.service.Neo4jService;

import java.time.LocalDateTime;

/**
 * Designed By Lne.
 * 2021/3/18 11:36
 */
@Configuration
@EnableScheduling
@RequiredArgsConstructor
public class Neo4jSechedule {
    private final Neo4jService neo4jService;
//    每天凌晨一点执行
    @Scheduled(cron = "0 0 1 * * ?")
    private void mysql2Neo4jTasks() {
        System.out.println("执行mysql导入neo4j");
        neo4jService.mySqlToNeo4j();
    }
}
